/*
 * Copyright 2020-2030 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.gitee.minimalismstyle.fresh.sys.vo.admin

import com.gitee.minimalismstyle.fresh.common.core.domain.Node

/**
 * PC端管理VO 菜单
 * @author maoxiaodong
 */
data class Menu(var key: String? = null) : Node<Menu, String> {
    /** Text of menu item, can be choose one of  `text` or `i18n` (Support HTML) */
    var text: String? = null

    /** I18n key of menu item, can be choose one of  `text` or `i18n` (Support HTML) */
    var i18n: String? = null

    /** Whether to display the group name, default: `true` */
    var group: Boolean? = false

    /** Routing for the menu item, can be choose one of `link` or `externalLink` */
    var link: String? = null

    /** External link for the menu item, can be choose one of `link` or `externalLink` */
    var externalLink: String? = null

    /** Specifies `externalLink` where to display the linked URL '_blank' | '_self' | '_parent' | '_top'*/
    var target: String? = null

    /** Icon for the menu item, only valid for the first level menu */
    var icon: String? = null

    /** Badget for the menu item when `group` is `true` */
    var badge: Int? = null

    /** Whether to display a red dot instead of `badge` value */
    var badgeDot: Boolean? = null

    /** Badge [color](https://ng.ant.design/components/badge/en#nz-badge) */
    var badgeStatus: String? = null

    /** Whether disable for the menu item */
    var disabled: Boolean? = null

    /** Whether hidden for the menu item */
    var hide: Boolean? = false

    /** Whether hide in breadcrumbs, which are valid when the `page-header` component automatically generates breadcrumbs */
    var hideInBreadcrumb: Boolean? = null

    /** ACL configuration, it's equivalent to `ACLService.can(roleOrAbility: ACLCanType)` parameter value */
    var acl: Any? = null

    /** Whether shortcut menu item */
    var shortcut: Boolean? = null

    /** Wheter shortcut menu root node */
    var shortcutRoot: Boolean? = null

    /** Whether to allow reuse, need to cooperate with the `reuse-tab` component */
    var reuse: Boolean = true

    /** Whether to expand, when `checkStrictly` is valid in `sidebar-nav` component */
    var open: Boolean? = null

    /** Children menu of menu item */
    override var children: MutableList<Menu>? = mutableListOf()

    override var id: String? = null
        get() = key
    override var parentId: String? = null
    override var sort: Int = Int.MAX_VALUE
}